from datetime import datetime
from typing import Any


def format_datetime(value: Any) -> str:
    if isinstance(value, datetime):
        return value.strftime('%Y-%m-%d %H:%M:%S')
    return value
